import request from '@/utils/request'

// 获取巡检状态下拉列表
export function getInspectionStatusList() {
  return request({
    url: '/operation/web/operationEquipmentInspection/inspectionStatusList',
    method: 'get'
  })
}

// 获取设备下拉列表
export function getDeviceList() {
  return request({
    url: '/operation/web/operationEquipmentInspection/deviceList',
    method: 'get'
  })
}

// 获取巡检类型下拉列表
export function getInspectionTypeList() {
  return request({
    url: '/operation/web/operationEquipmentInspection/inspectionTypeList',
    method: 'get'
  })
}

// 获取执行人下拉列表
export function getExecutorList() {
  return request({
    url: '/operation/web/schedules/userList',
    method: 'get'
  })
}

// 查询设备巡检列表
export function getInspectionList(params) {
    
  return request({
    url: '/operation/web/operationEquipmentInspection/list',
    method: 'get',
    params
  })
}

// 获取设备巡检详细信息
export function getInspectionDetail(id) {
  return request({
    url: `/operation/web/operationEquipmentInspection/${id}`,
    method: 'get'
  })
}

// 开始巡检
export function startInspection(data) {
  return request({
    url: '/operation/web/operationEquipmentInspection/startInspection',
    method: 'post',
    data
  })
}

// 结束巡检
export function finishInspection(params) {
  return request({
    url: '/operation/web/operationEquipmentInspection/finishInspection',
    method: 'get',
    params
  })
}

// 新增设备巡检
export function addInspection(data) {
  return request({
    url: '/operation/web/operationEquipmentInspection',
    method: 'post',
    data
  })
}

// 删除设备巡检
export function deleteInspection(ids) {
  return request({
    url: `/operation/web/operationEquipmentInspection/${ids}`,
    method: 'delete'
  })
}